<layout name='layout' />

<div class="admin-main">
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend>站点设置</legend>
	</fieldset>

	<form id="ajaxForm" class="layui-form" method="post" action="<{:U('Setting/insert')}>">
		
		<div class="layui-form-item">
			<label class="layui-form-label">LOGO</label>
			<div class="layui-inline">
				<img class="thumb" id="logo_src" src="<?php if(C('site_logo')!=""){ ?><{:C('site_logo')}><?php }else{ ?><{:STATICS}>/image/image.jpg<?php } ?>" />
				<input type="hidden" name="site_logo" id="logo_url" value="<{:C('site_logo')}>"/>								
			</div>
			<div class="layui-inline">
				<input type="button" value="上传" class="layui-btn layui-btn-small" onclick="uploadfile('<{:U('Upload/image',array('water'=>no,'thumb'=>no))}>','logo');"/>
				<input type="button" value="删除LOGO" class="layui-btn layui-btn-small" onclick="delImage('logo')"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">网站名称</label>
			<div class="layui-input-block">
				<input type="text" name="site_name" value="<{:C('site_name')}>" lay-verify="required" placeholder="请输入网站名称" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">网站Title</label>
			<div class="layui-input-block">
				<input type="text" name="site_title" value="<{:C('site_title')}>" lay-verify="required" placeholder="请输入网站名称" class="layui-input">
			</div>
		</div>	

		<div class="layui-form-item">
			<label class="layui-form-label">网址</label>
			<div class="layui-input-block">
				<input type="text" name="site_url" value="<{:C('site_url')}>" lay-verify="url" placeholder="请输入网址" class="layui-input">
			</div>
		</div>	

		<div class="layui-form-item">
			<label class="layui-form-label">微博</label>
			<div class="layui-input-block">
				<input type="text" name="site_weibo" value="<{:C('site_weibo')}>" placeholder="请输入网址" class="layui-input">
			</div>
		</div>	

		<div class="layui-form-item">
			<label class="layui-form-label">微信公众号</label>
			<div class="layui-inline">
				<img class="thumb" id="site_mp_src" src="<?php if(C('site_mp')!=""){ ?><{:C('site_mp')}><?php }else{ ?><{:STATICS}>/image/image.jpg<?php } ?>" />
				<input type="hidden" name="site_mp" id="site_mp_url" value="<{:C('site_mp')}>"/>								
			</div>
			<div class="layui-inline">
				<input type="button" value="上传" class="layui-btn layui-btn-small" onclick="uploadfile('<{:U('Upload/image',array('water'=>no,'thumb'=>no))}>','site_mp');"/>
				<input type="button" value="删除" class="layui-btn layui-btn-small" onclick="delImage('site_mp')"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">图片水印</label>
			<div class="layui-inline">
				<img class="thumb" id="water_src" src="<?php if(C('site_water')!=""){ ?><{:C('site_water')}><?php }else{ ?><{:STATICS}>/image/image.jpg<?php } ?>" />
				<input type="hidden" name="site_water" id="water_url" value="<{:C('site_water')}>"/>								
			</div>
			<div class="layui-inline">
				<input type="button" value="上传" class="layui-btn layui-btn-small" onclick="uploadfile('<{:U('Upload/image',array('water'=>no,'thumb'=>no))}>','water');"/>
				<input type="button" value="删除" class="layui-btn layui-btn-small" onclick="delImage('water')"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">版权所有</label>
			<div class="layui-input-block">
				<input type="text" name="copyright" value="<{:C('copyright')}>" lay-verify="required" placeholder="请输入公司或单位名称" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">用户注册</label>
			<div class="layui-input-block">
      			<input type="checkbox" <?php if(C('site_reg')==1){echo 'checked';}?> name="site_reg" value="1" lay-skin="switch" lay-filter="switchTest" title="开关">
    		</div>
  		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">备案号</label>
			<div class="layui-input-block">
				<input type="text" name="icp" value="<{:C('icp')}>" class="layui-input">
			</div>
		</div>	

		<div class="layui-form-item">
			<label class="layui-form-label">咨询热线</label>
			<div class="layui-input-block">
				<input type="text" name="site_tel" value="<{:C('site_tel')}>" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">传真</label>
			<div class="layui-input-block">
				<input type="text" name="site_fax" value="<{:C('site_fax')}>" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">客服QQ</label>
			<div class="layui-input-block">
				<input type="text" name="site_qq" value="<{:C('site_qq')}>" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">信箱</label>
			<div class="layui-input-block">
				<input type="text" name="site_email" value="<{:C('site_email')}>" class="layui-input">
			</div>
		</div>	

		<div class="layui-form-item">
			<label class="layui-form-label">地址</label>
			<div class="layui-input-block">
				<input type="text" name="site_address" value="<{:C('site_address')}>" class="layui-input">
			</div>
		</div>	

		<div class="layui-form-item">
			<label class="layui-form-label">关键词</label>
			<div class="layui-input-block">
				<textarea name="site_keyword" class="layui-textarea"><{:C('site_keyword')}></textarea>
				<p>一般不超过100个字，用英文逗号隔开</p>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">网站描述</label>
			<div class="layui-input-block">
				<textarea name="site_content" class="layui-textarea"><{:C('site_content')}></textarea>
				<p>一般不超过200个字</p>
			</div>
		</div>		

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
			</div>
		</div>
		<input type="hidden" name="files" value="info.php" />
	</form>
</div>
<!--上传文件-->
<form style="display:none;" id='myupload' action="" method='post' enctype='multipart/form-data'>
<input id="fileupload" type="file" name="file">
</form>
<div id="uploading" style="display:none;">
	<div class="wrapper">
		<div class="load-bar">   
			<div class="load-bar-inner" data-loading="0"> <span id="counter">0%</span> </div> 
		</div>  
		<p>请等待... </p>
	</div>
</div>
<script>
$("#tempBtn").click(function(){
	$("#status").val("0");
	$("#ajaxForm").submit();
});
</script>